package Java字符串;

public class 字符串比较 {
	  public static void main(String[] args) {
		String str="Hello word!";
		String anotherString="hello word";
		Object objstr=str;
		System.out.println(str.compareTo(anotherString));
		System.out.println(str.compareToIgnoreCase(anotherString));//忽大小写
		System.out.println( str.compareTo(objstr.toString()));
	}
}
  